#pragma once

#include "fxcc/core/graph/directX11/pch.h"

namespace fxcc
{
	namespace graph
	{
		namespace directX11
		{

			struct FXCC_API Win32App :public fxcc::platform::win32::App
			{
				Win32App(const Desc& desc);

				virtual bool Init();
				
				bool InitDirectX11();

				bool InitDevice();

				virtual int Run();
			
			public:

				virtual void OnFrameRender();

				virtual void OnUpdate();

				virtual void OnDestory();

				virtual void OnClose();

				virtual void OnFramebuffersize(int w, int h);


				bool OnResize(int w, int h);

				bool HasInitApp();

				bool m_HasInitFlag{ 0 };
			
			public:

				D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;

				D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
				
				ComPtr<ID3D11Device> g_pd3dDevice ;

				ComPtr<ID3D11Device1> g_pd3dDevice1;
				
				ComPtr<ID3D11DeviceContext> g_pImmediateContext ;
				
				ComPtr<ID3D11DeviceContext1> g_pImmediateContext1;
				
				ComPtr<IDXGISwapChain> g_pSwapChain;
				
				ComPtr<IDXGISwapChain1> g_pSwapChain1;
				
				ComPtr<ID3D11RenderTargetView> g_pRenderTargetView;

				ComPtr<IDXGIFactory2> dxgiFactory2;

				ComPtr<IDXGIFactory1> dxgiFactory;
			
				ComPtr<ID3D11DepthStencilView> m_DepthStencilView;
				
				ComPtr<ID3D11Texture2D> m_DepthStencilTexture;

			};
		};
	}
}